﻿using minichatclient;
using messageData;
using System.Runtime.Serialization.Formatters.Binary;
class Program
{
    public static void Main(string[] args)
    {
        Client client = new Client();
        client.Start();
        //client.user.uid = "u6";
        //client.selectAddedFriends();
        //client.addFriend("u3");
        //client.selectAddedGroup();
        //client.createGroup("gpo");
        //client.addGroup("g4");
        //client.deleteFriend("u5");
        //client.selectUserById("u4");
        //client.selectGroupUsers("g1");
        //client.selectGroupLikeName("gt");
        //client.selectUserLikeName("test");
        //client.addFriend("u2");
        //client.selectAddedFriends();
        //client.selectAllMessages("u2");
        //client.createGroup("errrr");


        //注册
        //User user = new User();
        //user.pwd = "234";
        //user.uname = "hehe";
        //client.register(user);



        //登录
        //string uid;
        //string password;
        //while (true)
        //{
        //    uid = Console.ReadLine();
        //    password = Console.ReadLine();
        //    client.login(uid, password);
        //    while ((client.login_failed || client.login_success) == false)
        //    {
        //    }
        //    if (client.login_success)
        //    {
        //        client.login_success = false;
        //        break;
        //    }
        //    else
        //    {
        //        client.login_failed = false;
        //    }
        //}
        //client.addGroup("g2");
        //client.sendSentence("heiheihei" + client.user.uid, "g1");
        //client.sendSentence("2222" + client.user.uid, "g1");
        //client.sendSentence("3333" + client.user.uid, "g1");
        //client.selectGroupMessages("g1");


        ////发文件
        Console.WriteLine("选择文件地址:");
        string path = Console.ReadLine();
        path += "\\";
        client.file_helper.path = path;

        Console.WriteLine("选择文件名");
        string file_name = Console.ReadLine();
        Console.WriteLine("选择接受者:");
        string receiver = Console.ReadLine();



        //发消息
        //string friend = "";
        //if (client.user.uid == "u1") friend = "u2";
        //else if (client.user.uid == "u2") friend = "u1";
        //else Console.WriteLine("uid不正确");
        //while(true)
        //{
        //    string s;
        //    s = Console.ReadLine();
        //    client.sendSentence(s, friend);
        //}


    }
}
